﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LuaInterface;

namespace LuaDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Lua lua = new Lua();//创建lua 解析器
            lua["name"] = "tanzhu"; //在C#中给lua创建 变量 ， 是一个全局变量
            lua["att"] = -20;
            lua.DoString("print(name)"); // C# 中执行lua 
            lua.DoFile("类的创建与继承.lua");

            string HP =(string) lua["HP"];
            double def = (double)lua["def"];
            bool dead = (bool)lua["dead"];
            Console.WriteLine("开始项目{0},{1},{2}", HP, def,dead);
            Console.Read();
        }
    }
}
